package net.scalan.jpa.model;

import java.io.Serializable;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.ManyToOne;

@Entity
public class DBELinkCanOtherHistory implements Serializable {

    private static final long serialVersionUID = 1L;

    //==========================================================================
    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    private Long id;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    //--------------------------------------------------------------------------
    @Column
    private Long can_id;

    /**
     * @return the can_id
     */
    public Long getCan_id() {
        return can_id;
    }

    /**
     * @param can_id the can_id to set
     */
    public void setCan_id(Long can_id) {
        this.can_id = can_id;
    }

    //==========================================================================
    @Column
    private Long dt;

    /**
     * @return the dt
     */
    public Long getDt() {
        return dt;
    }

    /**
     * @param dt the dt to set
     */
    public void setDt(Long dt) {
        this.dt = dt;
    }

    //--------------------------------------------------------------------------
    @Column
    private String dataString;

    /**
     * @return the dataString
     */
    public String getDataString() {
        return dataString;
    }

    /**
     * @param dataString the dataString to set
     */
    public void setDataString(String dataString) {
        this.dataString = dataString;
    }

    //--------------------------------------------------------------------------
    @Column
    private Boolean dataBits[] = new Boolean[64];
    
    /**
     * @return the dataBits
     */
    public Boolean[] getDataBits() {
        return dataBits;
    }

    /**
     * @param dataBits the dataBits to set
     */
    public void setDataBits(Boolean[] dataBits) {
        this.dataBits = dataBits;
    }

    //==========================================================================
    @ManyToOne
    private DBELink elink;

    /**
     * @return the elink
     */
    public DBELink getElink() {
        return elink;
    }

    /**
     * @param elink the elink to set
     */
    public void setElink(DBELink elink) {
        this.elink = elink;
    }

    //==========================================================================
    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof DBELinkCanOtherHistory)) {
            return false;
        }
        DBELinkCanOtherHistory other = (DBELinkCanOtherHistory) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "net.scalan.jpa.model." + this.getClass().getName() + "[id=" + id + "]";
    }
}
